<!--
 * @Description: 事件
 * @Author: charles
 * @Date: 2021-11-09 09:22:10
 * @LastEditors: charles
 * @LastEditTime: 2021-11-10 09:45:46
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>事件机制</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/react/17.0.2/umd/react.production.min.js"></script>
  <script src="https://cdn.bootcdn.net/ajax/libs/react-dom/17.0.2/umd/react-dom.production.min.js"></script>
  <script src="https://cdn.bootcss.com/babel-standalone/6.26.0/babel.min.js"></script>
</head>
<body>
  <div id="app"></div>

  <script type="text/babel">

    function MyList(props){
      return (
        <div>
          <h3>mylist</h3>
          <p>{props.name}</p>  
        </div>
      )
    }


    class App extends React.Component {
      render(){
        return (
          <div>
            <h2>组件通信</h2>
            <MyList name="hello"></MyList>
          </div>
        )
      }
    }
    ReactDOM.render(<App/>,document.getElementById('app'))
  </script>
</body>
</html>